package com.yang.controller;


import com.yang.pojo.Age;
import com.yang.pojo.ResultBody;
import com.yang.service.AgeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;


@RestController
public class AgeController {
    @Autowired
    private AgeService ageService;
    @GetMapping("/selectAgeAndMonth")
    @ResponseBody
    @CrossOrigin(origins = "*",maxAge = 3600)
    public ResultBody selectAgeAndMonth(){
        List<Age> ageList = ageService.allAge();
        return ResultBody.ok().data("selectAgeAndMonth",ageList);
    }
}
